package com.base.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.base.mapper.voipmapper.OperationlogsMapper;
import com.base.po.sqlparam.OperationlogsExamplePage;
import com.base.po.voip.Operationlogs;
import com.base.po.voip.OperationlogsExample;
import com.base.service.LogsService;
import com.base.utils.Page;
import com.base.utils.Produce;
import org.springframework.stereotype.Service;

@Service("logsService")
public class LogsServiceImpl implements LogsService {
	@Autowired
	OperationlogsMapper operationlogsMapper;

	@Override
	public int deleteByPrimaryKey(String id) {
		if (id == null) {
			return 0;
		}
		return operationlogsMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(Integer type, String content, String name, Boolean datestatus, String ipinfo) {
		Operationlogs operationlogs = new Operationlogs(Produce.getUUID(), type, content, Produce.getNowDate(), name,
				datestatus, ipinfo);
		return operationlogsMapper.insert(operationlogs);
	}

	@Override
	public Operationlogs selectByPrimaryKey(String id) {
		if (id == null) {
			return null;
		}
		return operationlogsMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(Operationlogs record) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return operationlogsMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int countByExample(OperationlogsExample example) {
		if (example == null) {
			return 0;
		}
		return operationlogsMapper.countByExample(example);
	}

	@Override
	public int deleteByExample(OperationlogsExample example) {
		if (example == null) {
			return 0;
		}
		return operationlogsMapper.deleteByExample(example);
	}

	@Override
	public int insert(Operationlogs record) {
		return operationlogsMapper.insert(record);
	}

	@Override
	public int insertSelective(Operationlogs record) {
		return operationlogsMapper.insertSelective(record);
	}

	@Override
	public List<Operationlogs> selectByExample(OperationlogsExample example) {
		return operationlogsMapper.selectByExample(example);
	}

	@Override
	public List<Operationlogs> selectByExamplePage(OperationlogsExamplePage example) {
		return operationlogsMapper.selectByExamplePage(example);
	}

	@Override
	public int updateByExampleSelective(Operationlogs record, OperationlogsExample example) {
		return operationlogsMapper.updateByExampleSelective(record, example);
	}

	@Override
	public int updateByExample(Operationlogs record, OperationlogsExample example) {
		return operationlogsMapper.updateByExample(record, example);
	}

	@Override
	public int updateByPrimaryKey(Operationlogs record) {
		return operationlogsMapper.updateByPrimaryKey(record);
	}

	@Override
	public List<Operationlogs> selectByAll(Page page, String ipinfo, String name, String timeFrom, String timeTo) {
		
		return operationlogsMapper.selectByAll(page, ipinfo, name, timeFrom, timeTo);
	}

	@Override
	public List<Operationlogs> selectByName(Page page, String name, String ipinfo, String timeFrom, String timeTo) {
		
		return operationlogsMapper.selectByName(page, name, ipinfo, timeFrom, timeTo);
	}

	@Override
	public List<Operationlogs> selectByType5() {
		return operationlogsMapper.selectByType5();
	}

	@Override
	public List<Operationlogs> selectByType6() {
		return operationlogsMapper.selectByType6();
	}

	@Override
	public List<Operationlogs> selectByType7() {
		return operationlogsMapper.selectByType7();
	}

	@Override
	public int countByAll(String ipinfo, String name, String timeFrom, String timeTo) {
		
		return operationlogsMapper.countByAll(ipinfo, name, timeFrom, timeTo);
	}

	@Override
	public int countByName(String name, String ipinfo, String timeFrom, String timeTo) {
		
		return operationlogsMapper.countByName(name, ipinfo, timeFrom, timeTo);
	}
}
